<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTableVotes extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('votes', function (Blueprint $table) {
            $table->increments('id');       // 主键
            $table->integer('tid');         // 话题id
            $table->integer('uid');         // 用户id
            $table->string('ip', 15);       // 用户ip
            $table->integer('sid');         // 选项id
            $table->dateTime();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('votes');
    }
}
